const multer = require("@koa/multer");
const upload = multer();
module.exports = (app) => {
  const {
    controller,
    router,
    config: { api },
  } = app;
  router.get(`${api.v1}test`, controller.merit.totalLogByType);
  router.get(`${api.v1}ips/:ip?`, controller.index.getIPLocation);
  router.get(`${api.v1}config`, controller.index.getConfig);
  router.get(`${api.v1}update`, controller.index.update);
  router.get(`${api.v1}music/list`, controller.music.list);
  router.get(`${api.prefix}alioss_sts`, controller.oss.sts.assumeRole);
  router.post(`${api.prefix}test`, upload.single("file"), async (ctx) => {
    console.log("ctx.request.file", ctx.request.file);
    console.log("ctx.file", ctx.file);
    console.log("ctx.request.body", ctx.request.body);
    ctx.body = "done";
  });
};
